package com.example.web;

import javax.servlet.*;
import java.io.IOException;

public class HelloServlet2 implements Servlet {

    public HelloServlet2() {
        System.out.println("【1】Servlet的构造器方法执行....");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("【2】Servlet的init方法执行...servletConfig = " + servletConfig);
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("【3】Servlet的service方法执行....helloServlet2");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("【4】Servlet的销毁方法destroy执行...");
    }
}
